<div data-role="header" data-theme="k"
	class="ui-btn-active ui-state-persist" data-position="fixed">
	<h1>利用者一覧</h1>
</div>

<!-- Client List -->
<div role="main" class="ui-content jqm-content jqm-fullwidth">

	<div class="ui-grid-a ui-responsive" data-mini="true">

		<div class="ui-body ui-body-h ui-corner-all">
			<div data-role="collapsible" data-theme="d" data-content-theme="f"
				data-iconpos="right" data-collapsed-icon="search"
				data-expanded-icon="delete" data-mini="true">
				<h3 class="ui-bar ui-bar-a" data-mini="true">利用者一覧</h3>
				<!-- Patient list -->

				<table style="width: 100%;">
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_1'
								onchange="disableSearchOption('search_1','search_1_text')"
								name="chkSearchClientName" data-mini="true" checked="checked"
								data-theme="f">氏名</label></td>
						<td style="width: 70%;"><input type="text"
							name="txtSearchClientName" id="search_1_text" value=""
							data-mini="true" placeholder="Name" data-theme="f"></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_2'
								onchange="disableSearchOptionForDropDown('search_2','search_2_text')"
								name="chkSearchAge" data-mini="true" checked="checked"
								data-theme="f">年齢</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_2_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_3'
								onchange="disableSearchOptionForDropDown('search_3','search_3_text')"
								name="chkSearchGroup" data-mini="true" checked="checked"
								data-theme="f">担当施設</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_3_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_4'
								onchange="disableSearchOptionForDropDown('search_4','search_4_text')"
								name="chkSearchNCL" data-mini="true" checked="checked"
								data-theme="f">介護度</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_4_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_5'
								onchange="disableSearchOptionForDropDown('search_5','search_5_text')"
								name="chkSearchSF" data-mini="true" checked="checked"
								data-theme="f">支援機関</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_5_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_6'
								onchange="disableSearchOptionForDropDown('search_6','search_6_text')"
								name="chkSearchFDoc" data-mini="true" checked="checked"
								data-theme="f">かかりつけ医</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_6_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_7'
								onchange="disableSearchOptionForDropDown('search_7','search_7_text')"
								name="chkSearchCm" data-mini="true" checked="checked"
								data-theme="f">担当ケアマネ</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_7_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td style="width: 30%;"><label><input type="checkbox"
								id='search_8'
								onchange="disableSearchOptionForDropDown('search_8','search_8_text')"
								name="chkSearchRemark" data-mini="true" checked="checked"
								data-theme="f">備考</label></td>
						<td style="width: 70%;"><select name="select-custom-k"
							id="search_8_text" data-native-menu="false" data-mini="true"
							data-theme="f">
								<option value="1">&nbsp;</option>
								<option value="2">The 2nd Option</option>
								<option value="3">The 3rd Option</option>
								<option value="4">The 4th Option</option>
						</select></td>
					</tr>
					<tr>
						<td colspan="2" style="width: 100%;"><a href="#"
							data-role="button" data-inline="true" data-theme="j"
							data-mini="true" data-icon="search" style="width: 95%;">検索</a></td>
					</tr>
				</table>
			</div>
			<!-- New registration button -->
			<a href="#" data-role="button" data-inline="true" data-theme="b"
				data-mini="true"><img
				src="<?php echo $this->basePath().'/img/AddNew.png'?>" width="18px"
				height="18px" alt=""> &nbsp; 新規登録</a> <a href="#" data-role="button"
				data-inline="true" data-theme="b" data-mini="true"><img
				src="<?php echo $this->basePath().'/img/printer.ico'?>" width="18px"
				height="18px" alt="">&nbsp; 印刷 </a> <a href="#" data-role="button"
				data-inline="true" data-theme="b" data-mini="true"><img
				src="<?php echo $this->basePath().'/img/excel.png'?>" width="18px"
				height="18px" alt="">&nbsp; エクセル</a>

			<!-- 			table was here -->
			<table data-role="table" id="table-custom-2" data-mode="columntoggle"
				data-mini="true"
				class="ui-body-d ui-shadow table-stripe ui-responsive"
				data-column-btn-theme="b" data-column-btn-text=" Select "
				data-column-popup-theme="a">
				<thead>
					<tr class="ui-bar-h">
					<?php
					$columnList = current ( $rowset );
					$i = 0;
					foreach ( $columnList as $column => $value ) {
						$i ++;
						if ($column == "氏名") {
							echo "<th>$column</th>";
						} else {
							echo "<th data-priority='$i'>$column</th>";
						}
					}
					?>				
					</tr>
				</thead>
				<tbody>
					
					<?php
					$row_num = 0;
					foreach ( $rowset as $row ) {
						$row_num = $row_num + 1;
						echo "<tr>";
						foreach ( $row as $column => $value ) {
							if ($column == "氏名") {
								echo "<td><a href='#popupMenu' data-rel='popup' data-transition='slideup'>$value</a></td>";
							} else if ($column == "選択") {
								echo "<td>$row_num</td>";
							} else {
								echo "<td>$value</td>";
							}
						}
						echo "</tr>";
					}
					?>	
					
				</tbody>
			</table>
		</div>
	</div>
</div>
<!-- /Client list -->

<!-- Client view -->
<div data-role="panel" data-position="right" data-display="overlay"
	data-theme="a" id="add-form" style="width: 50%;">
	<div class="ui-corner-all custom-corners">
		<h3 align="center">利用者編集・登録</h3>
		<div>
			<table style="width: 100%;">
				<tr>
					<td><label>ID</label></td>
					<td>4</td>
				</tr>
				<tr>
					<td><label for="basic">利用者名</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						value="藤本 明日" readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">氏名かな</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						value="ふじもとあすか" readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">出生日</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						value="2/2/1936" readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">死亡日</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">性別</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						value="checkboxes need 男 女" readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">利用可否</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						value="checkbox need 利用可能" readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">備考</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">登録日</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">最終更新日</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						readonly="readonly" /></td>
				</tr>
				<tr>
					<td><label for="basic">最終更新者</label></td>
					<td><input type="text" name="name" id="basic" data-mini="true"
						readonly="readonly" /></td>
				</tr>
			</table>

		</div>
	</div>
</div>
<!-- /Client view -->
<div data-role="footer" data-position="fixed" data-theme="k">
	<div data-role="navbar">
		<ul>
			<li><a href="<?php echo $this->basePath();?>" data-icon="user"
				data-role="button" class="ui-btn-active ui-state-persist">利用者一覧</a></li>
			<!-- Patient list -->
			<li><a
				href="<?php echo $this->basePath().'/index.php/admin/assessment';?>"
				class="" data-icon="bullets" data-role="button">アセスメントシート</a></li>
			<!-- Assessment sheet -->
			<li><a href="<?php echo $this->basePath().'/index.php/admin/week';?>"
				data-icon="calendar" data-role="button">週間利用者一覧</a></li>
			<!-- Week list -->
			<li><a href="<?php echo $this->basePath().'/index.php/admin/item';?>" data-icon="gear" data-role="button">実施項目設定</a></li>
			<!-- carepad item setting -->
			<li><a href="<?php echo $this->basePath().'/index.php/admin/record';?>" data-icon="grid" data-role="button">通所介護記録一覧</a></li>
			<!-- carepad record list -->
		</ul>
	</div>
	<!-- /navbar -->
</div>
<div data-role="popup" id="popupMenu" data-theme="b">
	<ul data-role="listview" data-inset="true" style="min-width: 210px;">
		<li data-role="list-divider">Choose an action</li>
		<li><a href="#add-form">View details</a></li>
		<li><a href="#">Edit</a></li>
		<li><a href="#">Delete</a></li>
		<li><a href="#">Assessment</a></li>
	</ul>
</div>